<template>
	<view>
		<view v-if="orders">
			<u-cell-group>
				<u-cell-item :arrow="false">
					<view slot="title" style="">
						<text v-if="orders.orders_source_id==1">后台录入</text>
						<text v-if="orders.orders_source_id==2">系统商城</text>
						<text v-if="orders.orders_source_id==3">哈罗</text>
						<text v-if="orders.orders_source_id==4">飞猪</text>
						<text v-if="orders.orders_source_id==5">携程</text>
						<text v-if="orders.orders_source_id==6">滴滴打车</text>
						<text v-if="orders.orders_source_id==7">第三方推荐</text>
						<text style="margin-left: 30rpx;">{{orders.orders_num}}</text>
					</view>
					<view slot="right-icon" style="color: #2979ff;" @click="coppy(orders.orders_num)">
						<text>复制</text>
						<u-icon name="file-text"></u-icon>
					</view>
				</u-cell-item>
			</u-cell-group>
		</view>
		<view>
			<u-cell-group>
				<u-cell-item v-for="item in orders.ordersDocList" :title="item.doc_name" @click="showImg(item.doc_src)">
					<view slot="label" style="display: flex;justify-content: flex-start;">
						<view>{{item.employe_name}}</view>
						<view style="margin: 0 20rpx;">|</view>
						<view>{{$u.timeFormat(item.tjsj, 'yyyy-mm-dd hh:MM:ss') }}</view>
					</view>
				</u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				host: 'https://cos2.ksmeilv.com',
				orders: null
			}
		},
		onLoad(options) {
			if (options.data) {
				this.orders = JSON.parse(decodeURIComponent(options.data));
				console.log(this.orders);
			}
		},
		methods: {
			getList(img) {
				var arry = [];
				if (!img) {
					return arry;
				}
				arry = img.split(",");
				for (var i = 0; i < arry.length; i++) {
					arry[i] = this.host + arry[i];
				}
				return arry;
			},
			showImg(e){
				var that=this;
				uni.previewImage({
					urls:that.getList(e)
				})
			},
			coppy(text) {
				uni.setClipboardData({
					data: text,
					success: function() {
						uni.showToast({
							title: '复制成功',
							icon: 'success',
							duration: 1000
						});
					}
				});
			},
		}
	}
</script>

<style>

</style>